package com.hsp.exception_;

public class ClassCastException_ {
    public static void main(String[] args) {
        A b = new B();
        B b2 = (B)b;//向下转型， 这里是OK
        C c2 = (C)b;//这里抛出ClassCastException

    }
}

class A{}
class B extends A{}
class C extends A{}